<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>交易详情</title>
<link type="text/css" href="${staticResources}/css/transaction.css" rel="stylesheet" />
<script type="text/javascript" src="${staticResources}/js/ajax.js"></script>
<script type="text/javascript">
function evalTransaction(tsid, eval_v) {
	var params = "mode=ajax";
	params+="&tsid="+encodeURIComponent(tsid);
	params+="&eval="+encodeURIComponent(eval_v);
	
	doAjax("EvaluateTransaction"
			,params,function(rst){
		var rst=eval('(' +rst+ ')');
		if (rst.status == 0) {
			alert("评价成功！")
			location.reload();
		} else {
			alert(rst.message);
		}
	});
}
</script>
</head>

<body style=" background: url('${staticResources}/image/greenbc.gif');">
<div id="header">
  <div id="hy">
    <c:if test="${user eq null }">
    <div id="logo">欢迎光临中国药科大学二手书交易平台!请<span><a href="${contextPath }/Account/Login">登录</a></span> 免费<span><a href="${contextPath }/Account/Register">注册</a></span></div>
    </c:if>
    <c:if test="${user ne null }">
    <div id="sc">
      <ul>
        <li><a href="${contextPath }/Account/Logout">注销</a></li>
        <li><a href="${contextPath }/Me?content=201">收藏夹</a></li>
        <li><a href="${contextPath }/Me">个人中心</a></li>
        <li>欢迎你，<b>${fn:escapeXml(user.nickName) }</b>！</li>
      </ul>
    </div>
    </c:if>
   </div>
   <div id="top"  style=" background: url('${staticResources}/image/listcommentsbc_03.gif');">
      <div class="tx">
	    <dl>
	     <c:choose>
           <c:when test="${empty user.userPicture }">
             <img src="${staticResources}/image/userpics_none.jpg" width="132" height="132" alt="">
           </c:when>
           <c:otherwise>
             <img src="${userContents}/userpics/${user.userPicture }" width="132" height="132" alt="">
           </c:otherwise>
	     </c:choose>
	    </dl>
	  </div>
	  <div class="xx">
	     <dl class="nc">${fn:escapeXml(user.nickName)}</dl>
		 <dl class="degree">活跃度：${user.activityPoint}</dl>
		 <dl class="degree">信誉度：${user.creditPoint}</dl>
		 <dl class="degree">个性签名：${fn:escapeXml(user.signature)}</dl>
	  </div>
   </div>
 </div>
   <div id="nav" style=" background: url('${staticResources}/image/listcomments_07.gif');">
    <ul>
      <li><a href="${contextPath }/Homepage">首页</a></li>
      <li><a href="${contextPath }/Books/Search">交易广场</a></li>
      <li><a href="${contextPath }/Auctions/Search">拍卖中心</a></li>
      <li><a href="#">读者推荐</a></li>
      <li><a href="${contextPath }/Comment/ListComments">留言板</a></li>
      <li><a href="#">新手指南</a></li>
    </ul>
   </div>
  
<!--头部结束-->
    <div class="main">
	    <div class="state">
	    	<c:choose>
	    	  <c:when test="${transaction.state.code eq 1 }">
	    	    <div class="s" style="background-color:gold;">请联系对方完成交易！</div>
	    	  </c:when>
	    	  <c:when test="${transaction.state.code eq 2 }">
	    	    <div class="s" style="background:url(${staticResources}/image/gougou.png) no-repeat 260px; background-color:#8EFF8E;">交易成功！</div>
	    	  </c:when>
	    	</c:choose>
		</div>
		<div class="smain">
		     <div class="lmain">
			      <div class="mtx">
			        <c:choose>
			          <c:when test="${empty transaction.seller.userPicture }">
			            <img src="${staticResources}/image/userpics_none.jpg" width="100" height="100" alt="">
			          </c:when>
			          <c:otherwise>
			            <img src="${userContents}/userpics/${transaction.seller.userPicture }" width="100" height="100" alt="">
			          </c:otherwise>
			        </c:choose>
			      </div>
				  <div class="wz">卖家</div>
				  <div class="nr">
				        <dl class="text">
						    <dd>昵称：${fn:escapeXml(transaction.seller.nickName) }</dd>
							<dd>活跃度：${fn:escapeXml(transaction.seller.activityPoint) }</dd>
							<dd>信誉度：${fn:escapeXml(transaction.seller.creditPoint) }</dd>
							<dd><b>真实姓名：${fn:escapeXml(transaction.seller.realName) }</b></dd>
							<dd>学工号：${fn:escapeXml(transaction.seller.staffID) }</dd>
							<dd>个性签名：${fn:escapeXml(transaction.seller.signature) }</dd>
							<dd><b>邮箱：${fn:escapeXml(transaction.seller.emailAddr) }</b></dd>
							<dd><b>电话号码：${fn:escapeXml(transaction.seller.phoneNumber) }</b></dd>
							<dd>注册日期：${fn:escapeXml(transaction.seller.formattedCreateDate) }</dd>
						</dl>
				  </div>
			 </div>
			 <div class="rmain">
			      <div class="mtx">
			        <c:choose>
			          <c:when test="${empty transaction.buyer.userPicture }">
			            <img src="${staticResources}/image/userpics_none.jpg" width="100" height="100" alt="">
			          </c:when>
			          <c:otherwise>
			            <img src="${userContents}/userpics/${transaction.buyer.userPicture }" width="100" height="100" alt="">
			          </c:otherwise>
			        </c:choose>
			      </div>
				  <div class="wz">买家</div>
				  <div class="nr">
				       <dl class="text">
						    <dd>昵称：${fn:escapeXml(transaction.buyer.nickName) }</dd>
							<dd>活跃度：${fn:escapeXml(transaction.buyer.activityPoint) }</dd>
							<dd>信誉度：${fn:escapeXml(transaction.buyer.creditPoint) }</dd>
							<dd><b>真实姓名：${fn:escapeXml(transaction.buyer.realName) }</b></dd>
							<dd>学工号：${fn:escapeXml(transaction.buyer.staffID) }</dd>
							<dd>个性签名：${fn:escapeXml(transaction.buyer.signature) }</dd>
							<dd><b>邮箱：${fn:escapeXml(transaction.buyer.emailAddr) }</b></dd>
							<dd><b>电话号码：${fn:escapeXml(transaction.buyer.phoneNumber) }</b></dd>
							<dd>注册日期：${fn:escapeXml(transaction.buyer.formattedCreateDate) }</dd>
						</dl>
				  </div>
			 </div>
			 <div class="mmain">
			    <dl class="book"><img src="${staticResources}/image/transaction_03.gif" width="191" height="120" alt="" /></dl>
				<dl class="text">
				    <dd>书名：${fn:escapeXml(transaction.book.name) }</dd>
					<dd>主编：${fn:escapeXml(transaction.book.chiefEditor) }</dd>
					<dd>版本：${fn:escapeXml(transaction.book.version) }</dd>
					<dd>出版社：${fn:escapeXml(transaction.book.publisher) }</dd>
					<dd>分类：${fn:escapeXml(transaction.book.category.name) }</dd>
					<dd>新旧程度：${transaction.book.condition }</dd>
					<dd>笔记：${transaction.book.hasNote }</dd>
					<!-- <dd>卖家描述：物美价廉好东西</dd> -->
					<dd>成交价：￥${transaction.price }</dd>
					<dd>成交时间：${transaction.startingDate }</dd>
				</dl>
				<div class="pic">
				   <img src="${staticResources}/image/transaction_15.gif" width="60" height="60" alt="">&nbsp;
				   <img src="${staticResources}/image/transaction_15.gif" width="60" height="60" alt="">&nbsp;
				   <img src="${staticResources}/image/transaction_15.gif" width="60" height="60" alt="">&nbsp;
				</div>
				<div class="botton">
				    <div>
					<a href="#" onclick="evalTransaction(${transaction.tsID },2);return false;"><img src="${staticResources}/image/transaction4_18.gif" width="100" height="30" alt=""></a>
					<a href="#" onclick="evalTransaction(${transaction.tsID },4);return false;"><img src="${staticResources}/image/transaction4_20.gif" width="100" height="30" alt=""></a>
					</div>
				</div>
			 </div>
		</div>
	</div>
<!--中间部分结束-->
     <div class="bottom">中国药科大学版权所有</div>

<!--尾部结束-->
</body>
</html>